<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title></title>
		<link rel="stylesheet" href="css/font.css" />
		<link rel="stylesheet" href="css/common.css" />
		<link rel="stylesheet" href="css/user.css" />
		<script type="text/javascript">
			document.addEventListener('plusready', function() {
				//console.log("所有plus api都应该在此事件发生后调用，否则会出现plus is undefined。"

			});
		</script>
		
	</head>
	<body>
		<header class=" header-module ">
			<div class="flex-justify-align header-top">
				<a href="home.html" class="iconfont iconfanhuijiantou header-back"></a>
				<p class="header-title">登录</p>
				<span class="header-span"></span>
			</div>
		
		</header>
		<article class="middle-moudle">
			<section class="base-interval user-module ">
				<form id="login">
					<div class="user-item">
						<p>企业名称</p>
						<input type="text" name="account" >
					</div>
					<div class="user-item">
						<p>登录密码</p>
						<input type="password" name="pwd">
					</div>
					<div class="user-item">
						<button type="button" class="user-btn" onclick="login()">登录</button>
					</div>
					<div class="user-item" style="text-align: center;">
						<a href="register.html" style="text-decoration:underline;">立即注册</a>
					</div>
				</form>
			</section>
		</article>
	</body>
	<script src="js/jquery-3.0.0.min.js"></script>  
	<script src="js/gloab.js"></script>  
	<script>    
		function login(){
			$.ajax({    
				//请求方式    
				type:"GET",    
				//文件位置    
				url: basePath + "app/tcompany/login",  
				data: $("#login").serialize(),
				//返回数据格式为json,也可以是其他格式如    
				dataType: "json",    
				//请求成功拼接html    
				success: function(data){
					if(data.code==0){
						var company = JSON.stringify(data.company);
						localStorage.setItem("company",company);
						window.location.href = "home.html";
					}else{
						alert(data.msg);
					}
				}    
			}); 
	   }	
	</script>
</html>
